<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
            function actSelect(obj,pageName) {
                var pkid=obj;
                var sfeature = "dialogwidth:1300px;dialogheight:700px;center:yes;location:no;help:no;resizable:no;scroll:no;status:no";
                var arg = new Object();
                arg.doType = "select";
                if (pageName=="Tk_Detail"){
                    var rtn =dialog("../item/itemHieRelapQry_Tkctt.xhtml?strType=0&amp;strTkCttPkid="+pkid+"",arg,sfeature);
                }
            }
        </script>
        <style type="text/css">
            .img {
                width: 20px;
                height: 30px;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="form" enctype="multipart/form-data">
                <p:growl id="msgs" showDetail="true"/>
                <p:focus for="powerType"/>
                <p:panel id="inputTk" header="权限信息查询" style="width: 100%">
                    <h:panelGrid columns="2" style="width: 100%">
                        <h:panelGrid id="pgTkctt">
                            <h:panelGrid columns="6">
                                <h:outputLabel value="所属种类：" for="powerType" style="font-weight: bold"/>
                                <h:selectOneMenu id="powerType" value="#{esInitPowerHisAction.esInitPowerHis.powerType}"
                                                 style="width:133px">
                                    <f:selectItems value="#{esCommonAction.itemTypeList}"/>
                                    <p:ajax update="msgs,pgTkctt"
                                            listener="#{esInitPowerHisAction.setEsInitPowerHisActionOfPowerPkidAction}"/>
                                </h:selectOneMenu>
                                <h:outputLabel id="strLabel1"
                                                value="#{esInitPowerHisAction.strLabel1}："
                                                for="tkcttCstpl" style="font-weight: bold"
                                                rendered="#{esInitPowerHisAction.strRendered1}"/>
                                <h:selectOneMenu id="tkcttCstpl"
                                                 value="#{esInitPowerHisAction.strTkcttCstplSelected}"
                                                 style="width:339px"
                                                 rendered="#{esInitPowerHisAction.strRendered1}">
                                    <f:selectItems value="#{esInitPowerHisAction.esInitCtt1List}"/>
                                    <p:ajax update="msgs,pgTkctt"
                                            listener="#{esInitPowerHisAction.setFromTkAndCttToSStlAction}"/>
                                </h:selectOneMenu>
                                <h:outputLabel id="strLabel2"
                                               value="#{esInitPowerHisAction.strLabel2}："
                                               for="subcttStlTkcttMeaSta" style="font-weight: bold"
                                               rendered="#{esInitPowerHisAction.strRendered2}"/>
                                <h:selectOneMenu id="subcttStlTkcttMeaSta"
                                                 value="#{esInitPowerHisAction.esInitPowerHis.powerPkid}"
                                                 style="width:339px"
                                                 rendered="#{esInitPowerHisAction.strRendered2}">
                                    <f:selectItems value="#{esInitPowerHisAction.esInitCtt2List}"/>
                                </h:selectOneMenu>
                            </h:panelGrid>
                            <h:panelGrid columns="10">
                                <h:outputLabel value="期数编码：" for="pno" style="font-weight: bold"/>
                                <p:inputText id="pno" value="#{esInitPowerHisAction.esInitPowerHis.periodNo}"
                                             style="width:127px"/>
                                <h:outputLabel value="创建人名：" for="createid" style="font-weight: bold"/>
                                <p:inputText id="createid" value="#{esInitPowerHisAction.esInitPowerHis.createdBy}"
                                             style="width:127px"/>
                                <h:outputLabel value="创建时间：" for="createdate" style="font-weight: bold"/>
                                <p:inputText id="createdate" value="#{esInitPowerHisAction.esInitPowerHis.createdDate}"
                                             onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                             style="width:127px"/>
                                <h:outputLabel value="状态标志：" for="sf" style="font-weight: bold"/>
                                <p:selectOneMenu id="sf" value="#{esInitPowerHisAction.esInitPowerHis.statusFlag}"
                                                 style="width:131px">
                                    <f:selectItems value="#{esCommonAction.statusFlagList}"/>
                                </p:selectOneMenu>
                                <h:outputLabel value="状态原因：" for="preStatusFlag" style="font-weight: bold"/>
                                <p:selectOneMenu id="preStatusFlag" value="#{esInitPowerHisAction.esInitPowerHis.preStatusFlag}"
                                                 style="width:131px">
                                    <f:selectItems value="#{esCommonAction.preStatusFlagList}"/>
                                </p:selectOneMenu>
                            </h:panelGrid>
                        </h:panelGrid>
                        <h:panelGrid columns="1">
                            <p:commandButton id="qryBtn" value="查询"
                                             action="#{esInitPowerHisAction.onQueryAction()}"
                                             update="pdt,msgs">
                            </p:commandButton>
                            <p:commandButton id="resetBtn" value="重置"
                                             type="reset"
                                             update="inputTk,msgs">
                            </p:commandButton>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>

                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <!--列表维护-->
                <p:dataTable id="pdt" style="width:100%;"
                             value="#{esInitPowerHisAction.esInitPowerHisList}"
                             var="record"
                             rowKey="#{record.powerPkid}"
                             selectionMode="single"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true"
                             paginatorPosition="bottom"
                             rows="20"
                             rowsPerPageTemplate="200,100,50,40,30,20,10"
                             emptyMessage="数据记录为空..."
                             widgetVar="DtInitTkcttList">

                    <p:column headerText="pkid" style="display:none;" rendered="false">
                        <h:outputText id="tetid" style="display:none;" rendered="false" value="#{record.powerPkid}"/>
                    </p:column>

                    <p:column headerText="对象所属" style="text-align:center">
                        <h:outputText value="#{esCommonAction.getLabelByValueInItemTypeList(record.powerType)}"/>
                    </p:column>

                    <p:column headerText="对象" style="text-align:left">
                        <h:outputText value="#{esInitCttAction.getEsInitCttByPkId(record.powerPkid).name}"/>
                    </p:column>

                    <p:column headerText="期数编码" style="text-align:center">
                        <h:outputText value="#{record.periodNo}"/>
                    </p:column>

                    <p:column headerText="状态标志" style="text-align:center">
                        <h:outputText value="#{esPowerAction.getLabelByValueInStatusFlaglist(record.statusFlag)}"/>
                    </p:column>

                    <p:column headerText="创建人" style="text-align:center">
                        <h:outputText value="#{esCommonAction.opersMap.get(record.createdBy)}"/>
                    </p:column>

                    <p:column headerText="创建时间" style="text-align:center">
                        <h:outputText value="#{record.createdDate}"/>
                    </p:column>

                    <p:column headerText="状态原因" style="text-align:center">
                        <h:outputText value="#{esPowerAction.getLabelByValueInPreStatusFlaglist(record.preStatusFlag)}"/>
                    </p:column>

                    <p:column headerText="备注內容" style="text-align:center">
                        <h:outputText value="#{record.spareField}"/>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>